<template>
    <div>
        我是子组件Child1-
{{ num }}
        <button @click="handleClick">click</button>


        <hr/>
        <p>从父组件传来的title：</p>
        {{ title }} <br/>
        <p>从父组件传来的myname：</p>
        {{ myname }} <br/>
        <hr/>
        <button @click="$emit('enlarge-text')">子传父</button>
    </div>
</template>

<script>
    export default {
        name: "Child1",
        props: ['title','myname'],
        emits: ['enlarge-text'],
        data(){
            return{
                num:0
            }
        },
        methods:{
            handleClick(){
               this.num ++          
            }
        }
    }
</script>

<style scoped>
div
{
    height: 300px;
    background-color:yellow;
    color: blue;
}
</style>